#include <bits/stdc++.h>
using namespace std;
int q,l,r;
int main(void){
    scanf("%d",&q);
    while(q--){
        scanf("%d%d",&l,&r);
        int len=r-l+1;
        //第一个是奇数
        if(l%2==1){
            if(len%2==1){
                printf("%d\n",-1*r+(len-1)/2);
            }else{
                printf("%d\n",len/2);
            }
        }else{
            if(len%2==1){
                printf("%d\n",r-(len-1)/2);
            }else{
                printf("%d\n",-1*(len/2));
            }
        }
    }
    return 0;
}